Skip to content

fix: dedupe history and improve Discord channel parsing#77

Merged
jackwener merged 1 commit intojackwener:mainfrom
Pleasurecruise:fix-ui
Mar 19, 2026
Merged

fix: dedupe history and improve Discord channel parsing#77
jackwener merged 1 commit intojackwener:mainfrom
Pleasurecruise:fix-ui

Conversation

@Pleasurecruise
Copy link
Contributor

fix DOM retrieval issues in some playwright-based applications—for example

  • ChatWise the start and end of the conversation history may include irrelevant elements
  • Discord channel retrieval can be inaccurate.

History CLI: filter out date headers, numeric-only entries and model path strings, deduplicate titles while preserving first occurrence, and reindex results to produce a clean list. Discord channels CLI: switch to channel anchor links and robustly parse aria-labels (skip categories/placeholders, strip status prefixes, extract name and type), add support for stage/forum/announcement/voice types, and index results reliably to avoid spurious entries.
Copilot AI review requested due to automatic review settings March 19, 2026 00:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Playwright DOM scraping for two UI-driven CLIs by (1) making Discord channel discovery more precise and (2) filtering/deduping noisy ChatWise history entries.

Changes:

  • Update Discord channel scraping to parse channel name/type from aria-label on channel <a> links.
  • Post-process ChatWise history results to drop headers/noise entries and dedupe titles.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/clis/discord-app/channels.ts Switches to parsing channel entries from /channels/... link aria-label for improved accuracy.
src/clis/chatwise/history.ts Adds filtering + deduplication to remove non-conversation entries from sidebar history.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to +40
// Discord channel names are ASCII-only; skip placeholder entries (e.g. locked channels)
if (!name || !/^[\x20-\x7E]+$/.test(name)) return;
if (seen.has(t)) return false;
seen.add(t);
return true;
}).map((item: { Index: number; Title: string }, i: number) => ({ Index: i + 1, Title: item.Title }));
@jackwener jackwener merged commit 1f27039 into jackwener:main Mar 19, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants